<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <%@include file="/common/header.jsp"%>
</head>
<body>

<div class="container " style="margin-top: 20px">
    <%@include file="/common/top.jsp"%>
    <div class="row">
        <div class="col-sm-3">
            <%@include file="/common/menu.jsp"%>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">后台用户${user.username==null ? '注册' : '编辑'}</h1>
                </div>
            </div>
            <div class="row col-sm-10">
                <!-- 表单提交 -->
                <form action="/adminUser?cmd=registerTo" method="post" enctype="multipart/form-data"
                    id="editForm" class="form-horizontal">
                
                    <input type="hidden" name="id" value="${user.id}">
                
                    <div class="form-group" >
                        <label for="name" class="col-sm-2 control-label">用户名：</label>
                        <div class="col-sm-6">
                        <input type="text" class="form-control" id="username" name="username" 
                            value="${user.username}" ${user.username==null ? '' : 'readonly'}>
                        </div>
                    </div>
                    <div class="form-group" >
                        <label for="name" class="col-sm-2 control-label">密码：</label>
                        <div class="col-sm-6">
                        <input type="password" class="form-control" id="password" name="password" 
                            value="${user.password}" ${user.username!="admin" ? '' : 'readonly'}>
                        </div>
                    </div>
                    
                    <div class="form-group" >
                        <label for="name" class="col-sm-2 control-label">头像上传：</label>
                        <div class="col-sm-6">
                        <input type="file" class="form-control" id="file" name="imgPath"  >
                        </div>
                    </div>
                    
                    
                    <span style="padding-left: 9%;color: red;">${errorMessage}</span>
                    
                    <div class="form-group">
                        <div class="col-sm-offset-1 col-sm-6">
                            <button id="btn_submit" type="submit" class="btn btn-default">保存</button>
                            <button type="reset" class="btn btn-default">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
</body>
</html>